<template>
      <div class="pay" v-if="val">
        <div class="pay-box" v-for="item in val">
            <div class="pay-box-top">
                <span>待支付</span>
            </div>
            <div class="pay-box-middle">
                <div v-for="it in item" :key="it.id">
                    <van-card
                    :num="it.count"
                    :price="it.price * it.count"
                    :title="it.title"
                    :thumb="it.image"
                    />
                </div>
            </div>
            <div class="pay-box-bottom">
                <span>去支付</span>
                <span>删除此条</span>
            </div>
        </div>
    </div>
    <van-empty
        image="https://fastly.jsdelivr.net/npm/@vant/assets/custom-empty-image.png"
        image-size="80"
        description="您还没有相关内容"
        v-else
        />
  
</template>


<script setup>
import { computed, onMounted } from 'vue'
import { useStore } from 'vuex'
let store = useStore()

let val = computed(()=>store.getters['meModule/getToBePaid'])
onMounted(()=>{
    console.log(val.value);
})
</script>


<style lang="less" scoped>
@import '../../style/common.less';
.pay{
    background: @g4;
    padding: 8px;
    width: 100vw;
    height: calc(100vh - 46px);
    box-sizing: border-box;
    >.pay-box{
        background: @g1;
        width: 100%;
        height: 240px;
        border-radius: 8px;
        margin-bottom: 20px;
        box-sizing: border-box;
        position: relative;
        >.pay-box-top{
            width: 100%;
            height: 36px;
            border-bottom: 1px solid @g5;
            text-align: right;
            padding: 4px 20px 4px 0;
            >span{
                font-size: .7rem;
            }
        }
        >.pay-box-middle{
            height: 168px;
            overflow-x: hidden;
            border-bottom: 1px solid @g5;
        }
        >.pay-box-bottom{
            text-align: right;
            >span{
                display: inline-block;
                margin: 0 5px;
                font-size: .8rem;
                border: 1px solid @c10;
                color: @g1;
                background: @c10;
                border-radius: 8px;
                padding: 1px 6px;
                margin-top: 4px;
            }
        }
    }
}

/deep/.van-card{
    background: @g1;
    border-bottom: 1px solid @g5;
}
</style>